maintainer="Michał Polański <michal@polanski.me>"
pkgname=py3-sh
pkgver=2.1.0
pkgrel=0
pkgdesc="Python subprocess replacement"
url="https://sh.readthedocs.io/"
license="MIT"
arch="noarch"
makedepends="py3-gpep517 py3-poetry-core"
checkdepends="py3-pytest lsof coreutils"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/s/sh/sh-$pkgver.tar.gz"
builddir="$srcdir/sh-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
14defeb52c15d6571fe71b97f9b720e3cf161e905f4e7cbea12a5f4c27e14b28c86a4614189176cde4cf05920b86f927605df7cfb4e71accc44b3d58debaaece  py3-sh-2.1.0.tar.gz
"
